package com.vois.jack.btmgr.devices.WLBleDfuDevice;

public enum DfuMessage {
    DFU_ERROR_INFO_MESSAGE(0x10),
    DFU_PROGRESS_INFO_MESSAGE(0x11),
    DFU_UNKNOWN_MESSAGE(0xFF);

    private final int value;

    DfuMessage(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    static public DfuMessage valueOf(int value) {
        for (DfuMessage dfuMessage: DfuMessage.values()) {
            if (dfuMessage.getValue() == value) {
                return dfuMessage;
            }
        }

        return DFU_UNKNOWN_MESSAGE;
    }
}
